package com.xxx.video.mine.presenters;

import android.content.Context;

import androidx.annotation.NonNull;

import com.xxx.video.commen.dbs.beans.DownloadHistoryBean;
import com.xxx.video.commen.dbs.utils.DbUtils;
import com.xxx.video.commen.presenters.BasePresenter;
import com.xxx.video.commen.utils.ResponseUtils;
import com.xxx.video.mine.beans.LikeRecordBean;
import com.xxx.video.network.listeners.CommonResponseListener;
import com.xxx.video.network.utils.NetWorkUtils;

import java.util.List;

public class DownloadManagementPresenter extends BasePresenter<IDownloadManagementView> {

    public DownloadManagementPresenter(@NonNull Context context, IDownloadManagementView baseView) {
        super(context, baseView);
    }

    public void getDownloadList(int page) {
        List<DownloadHistoryBean> downloadHistoryBeanList = DbUtils.getInstance().getDownloadBeanList();
        if (getBaseView()!=null){
            getBaseView().initDownloadManagementList(downloadHistoryBeanList);
        }
//        NetWorkUtils.getInstance().getDownloadList(String.valueOf(page), new CommonResponseListener<LikeRecordBean>() {
//            @Override
//            public void onSuccess(LikeRecordBean successOb, String result) {
//                if (ResponseUtils.getInstance().isNoError(successOb)) {
//                    if (getBaseView() != null) {
//                        getBaseView().initDownloadManagementList(successOb);
//                    }
//                }
//            }
//
//            @Override
//            public void onFailure(Object failureObj) {
//                if (getBaseView() != null) {
//                    getBaseView().showRootLayoutStatus(3);
//                }
//            }
//        });
    }
}
